Create Customer Offer
This API is used to create an individual offer (Regular Plan) or a Pool Plan for a sub-account (customer).
| HTTP URL | |
|---|---|
| POST | api/v2/customer/{id}/offer |
Eligibility
The Requester is eligible to create new individual offers or Pool Plans for his sub-customers use. The Requester is not eligible to create new individual offers or new Pool Plans for its own profile use.
API Request
Request Structure
| Parameter | Type | M/O/CM | Description |
|---|---|---|---|
| name | String | M | Individual offer or Pool Plan offer name. Must be unique. |
| type | String | M | Type of the offer. ENUM valid values: USAGE, RATE, MONEY, POOL |
| renewalInterval | String | M | Renewal period interval. ENUM valid values: DAILY, WEEKLY, MONTHLY, QUARTERLY, SEMI_ANNUALLY, ANNUALLY, ONE_TIME |
| isProrated | Boolean | O | Determines whether proration is calculated when plan is attached to a subscriber. Pool plan is not supported, so a True setting is ignored for a Pool plan. Rate plan is not yet supported, so this parameter has no effect for a Rate plan. Range:
|
| isIncludingAccessFee | Boolean | O | Determine if the offer price already includes inherent access fee and surcharge fee.
|
| money | Object | CM | Money type information object. Mandatory when MONEY offer type was selected. Ignored if either a RATE or USAGE offer type was selected. |
| rate | Object | O | Rate type limits definition object. Filled-in only if limits are set at least for DATA or SMS consumption. Ignored if either a USAGE or MONEY offer type was selected. |
| usage | Object | CM | Usage type information object. Mandatory when USAGE offer type was selected. Ignored if either a RATE or MONEY offer type was selected. |
| pool | Object | CM | Pool plan type information object. Mandatory when POOL offer type was selected. Ignored if any other offer type was selected (USAGE, RATE, MONEY). |
| availabilityZone | UUID | O | Array of availability zone IDs which are assigned to this plan. Empty array means that the plan is available in any zone. |
Money data objects
| Element | Type | M/O/CM | Description |
|---|---|---|---|
| value | Decimal | M | Offer monetary value. May contain decimal value. |
|
currency |
String |
M |
Offer currency. For example, USD, GBP, EUR |
|
activationType |
String |
M |
Defines plan activation behavior. ENUM: REGULAR, FIRST_EVENT_PERIODIC, FIRST_EVENT_NON_PERIODIC |
Rate data objects
| Element | Type | M/O/CM | Description |
|---|---|---|---|
| dataLimit | Decimal | O | Define the maximum allowed DATA usage consumption. |
| dataLimitUnitType | String | CM |
Data limit unit type. ENUM valid values: KB, MB, GB
|
| smsLimit | Decimal | O | Define the maximum allowed SMS usage consumption. Unit counting is always a ‘unit’ for SMS type. |
Usage data objects
|
Element |
Type | M/O/CM | Description |
|---|---|---|---|
| cost | Decimal | M | Cost of the offer. May contain decimal value. |
|
currency |
String | M | Offer currency. for example, USD, GBP, EUR |
|
activationType |
String | M |
Defines plan activation behavior. ENUM: REGULAR, FIRST_EVENT_PERIODIC, FIRST_EVENT_NON_PERIODIC |
| offerDepletion | Boolean | CM | Rater behavior when offer allowances were depleted. Range:
|
| usageType | Object | M | Array of usage types object. |
Usage Type data objects
| Element | Type | M/O/CM | Description |
|---|---|---|---|
| type | String | M |
Type of the usage. ENUM valid values: DATA, SMS |
| value | Decimal | M | Allowance value. Data consumption for DATA type. Unit counting for SMS type. |
| unitType | String | CM |
Usage unit type. DATA . ENUM valid values: KB, MB, GB
|
| limitValue | Decimal | O |
Define usage limit value.
|
| limitUnitType | String | CM | Limit unit type. DATA ENUM valid values: KB, MB, GBMandatory when setting limit for DATA usage. Empty for SMS usage type.Ignored for a Usage-type plan and an error message is returned. |
Pool data objects
| Element | Type | M/O/CM | Description |
|---|---|---|---|
| subAccountID | UUID | M | UUID (Universal Unique ID) of the sub account that the new pool plan will serve. NOTE: No longer valid. Always populate with a NULL string. |
| type |
String |
M |
Pool plan type. ENUM valid values: FIXED, ACCUMULATIVE |
|
cost |
Decimal |
M |
Cost of the offer. May contain decimal value. |
|
currency |
String |
M |
Offer currency. for example, USD, GBP, EUR |
|
activationType |
String |
M |
Defines pool plan activation behavior. ENUM: REGULAR, FIRST_EVENT_PERIODIC, FIRST_EVENT_NON_PERIODIC |
|
usageType |
Object |
M |
Array of usage types object. |
API Response
Response Structure
|
Element |
Type |
M/O/CM |
Description |
|---|---|---|---|
|
errorCode |
String |
O |
Failure code. |
|
errorMessage |
String |
O |
Failure message. |
|
content |
Object |
O |
Array of main response body object displayed when an API call was successful. For a failure, it will be empty. |
| pageable |
Object |
O |
Paging information object displayed when an API call was successful. For a failure, it will be empty. |
Content data objects
|
Element |
Type |
M/O/CM |
Description |
|---|---|---|---|
|
offerId |
UUID |
M |
The UUID generated by a new offer |
|
requestId |
UUID |
M |
Request instance ID. To be used by external systems to query the call (operation) status: In progress Successful Failed. |
Pageable data objects
|
Element |
Type |
M/O/CM |
Description |
|---|---|---|---|
|
page |
Numeric |
M |
Page number |
|
size |
Numeric |
M |
Page size. Number of requested elements per page |
|
totalPages |
Numeric |
M |
Total amount of available pages per requested page size |
|
totalElements |
Numeric |
M |
Total amount of retrieved elements |
Error Codes
In addition to the general success and failure codes, the following error codes are possible.
|
Code |
Message |
|---|---|
|
GLOBAL_1001 |
Service unavailable. Please try again |
Examples
Request Body: Regular Plan
{
"name": "Basic roaming bundle",
"type": "USAGE",
"renewalInterval": "ONE_TIME",
"isProrated": true,
"isIncludingAccessFee": false,
"availabilityZone": [
"ab74dca1-8d7f-4b85-a42b-13822913c3b3"
],
"usage": {
"cost": 20.5,
"currency": "USD",
"activationType": "REGULAR",
"offerDepletion": false,
"eligibleSubAccountIds": [
"ee74dca6-8e7f-4b85-a42b-13860913b3b1",
"ff74dca6-8e7f-4b85-a42b-13860913b370"
],
"usageType": [
{
"type": "DATA",
"value": 50,
"unitType": "MB",
"limitValue": 20,
"limitUnitType": "MB"
},
{
"type": "SMS",
"value": 100,
"unitType": "",
"limitValue": 10,
"limitUnitType": ""
}
]
}
}
Request Body: Pool Plan
{
"name": "Accumulative Basic Pool Plan",
"type": "POOL",
"renewalInterval": "MONTHLY",
"isProrated": false,
"isIncludingAccessFee": false,
"availabilityZone": [
"ab74dca1-8d7f-4b85-a42b-13822913c3b3"
],
"pool": {
"subAccountId": "ee74dca6-8e7f-4b85-a42b-13860913b3b1",
"type": "ACCUMULATIVE",
"cost": 20.5,
"currency": "USD",
"activationType": "REGULAR",
"usageType": [
{
"type": "DATA",
"value": 50,
"unitType": "MB",
"limitValue": 20,
"limitUnitType": "MB"
},
{
"type": "SMS",
"value": 100,
"unitType": "",
"limitValue": 10,
"limitUnitType": ""
}
]
}
}
Response Body: Success ACK
{
"errorCode": "",
"errorMessage": "",
"content": [
{
"requestId": "ff74dca6-8e7f-4b85-a42b-13860913b370",
"offerId": "ee74dcd7-8e7f-4c45-a42b-13860913b129"
}
],
"pageable": {
"page": 0,
"size": 10,
"totalPages": 1,
"totalElements": 1
}
}
Response Body: Failure NAK
{
"errorCode": "GLOBAL_1001",
"errorMessage": "Service unavailable. Please try again",
"content": "",
"pageable": ""
}